package com.ajhlp.app.phoneDetailQuery.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

/**
 * 号码规则
 * @author ajhlp
 *
 */
@XStreamAlias("rule")
public class PhoneNumRule implements Comparable<PhoneNumRule> {

	@XStreamAsAttribute
	@XStreamAlias("key")
	private String rule;
	@XStreamAsAttribute
	private int price;
	@XStreamAsAttribute
	private String comment;
	@XStreamAsAttribute
	private String jsonMeta;
	
	public PhoneNumRule() {}
	
	public PhoneNumRule(String rule, int price, String comment, String jsonMeta){
		this.setRule(rule);
		this.setPrice(price);
		this.setComment(comment);
		this.setJsonMeta(jsonMeta);
	}
	
	public String getRule() {
		return rule;
	}
	public void setRule(String rule) {
		this.rule = rule;
	}
	public int getPrice() {
		return price;
	}
	public void setPrice(int price) {
		this.price = price;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getJsonMeta() {
		return jsonMeta;
	}

	public void setJsonMeta(String jsonMeta) {
		this.jsonMeta = jsonMeta;
	}

	public int compareTo(PhoneNumRule o) {
		// TODO Auto-generated method stub
		if(price == o.getPrice()){
			return 0;
		}else if(price > o.getPrice()){
			return 1;
		}else{
			return -1;
		}
		
	}
	
}
